package cn.com.gzheroli.rabbitmq.service.consumer;

import java.util.Map;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageListener;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.messaging.handler.annotation.Header;
import org.springframework.stereotype.Service;

import cn.com.gzheroli.core.common.mapper.CommonMapper;
import cn.com.gzheroli.core.util.NameHandler;
import cn.com.gzheroli.core.util.MyBatisSqlUtils;
import cn.com.gzheroli.rabbitmq.service.producer.FanoutProducerService;

/**
 * Created by lhx on 2016/9/5 17:52
 *
 * @Description
 */
public class FanoutConsumer  {
	private static final Logger logger = LoggerFactory.getLogger(FanoutConsumer.class);

    public static void main(final String... args) throws Exception {
        AbstractApplicationContext ctx = new ClassPathXmlApplicationContext("RabbitMQ.xml");
        FanoutProducerService fanoutProducer = (FanoutProducerService) ctx.getBean("fanoutProducerService");
        fanoutProducer.sendMessage("++++++fanoutProducer++++++++++++hello,xin3453465465467456456456^^^^^^66666!hello,xin");
        Thread.sleep(1000);
        ctx.destroy();
    }
}
